#include <iostream>
#include <queue>
#define MAXN 21
#define MAXK 1005
using namespace std;
int N, M, K, Q;
struct Person
{
	int id, serverTime;
	int BeginTime, EndTime;
	Person() : BeginTime(0), EndTime(-1), serverTime(0), id(0) {}
} Per[MAXK];
queue<Person> line[MAXN], wait;
int main()
{
	cin >> N >> M >> K >> Q;
	int cap = N * M;
	for (int i = 1; i <= K; ++i)
	{
		cin >> Per[i].serverTime;
		Per[i].id = i;
		if (i <= N)
		{
			Per[i].EndTime = Per[i].serverTime;
		}
		if (i <= N * M)
		{
			line[(i - 1) % N + 1].push(Per[i]);
		}
		else
		{
			wait.push(Per[i]);
		}
	}
	int countC = K;
	int nowTime = 0, closeTime = 9 * 60;
	while (nowTime < closeTime && countC)
	{
		nowTime++;
		for (int i = 1; i <= N; ++i)
		{
			if (line[i].empty())
			{
				continue;
			}
			Person head = line[i].front();
			if (head.EndTime <= nowTime || head.EndTime > closeTime)
			{
				line[i].pop();
				countC--;
				line[i].front().BeginTime = head.EndTime;
				line[i].front().EndTime = head.EndTime + line[i].front().serverTime;
				Per[head.id].BeginTime = head.BeginTime;
				Per[head.id].EndTime = head.EndTime;
				if (!wait.empty())
				{
					line[i].push(wait.front());
					wait.pop();
				}
			}
		}
	}
	int q;
	for (int i = 1; i <= Q; ++i)
	{
		cin >> q;
		if (Per[q].EndTime == -1)
		{
			cout << "Sorry" << endl;
		}
		else
		{
			printf("%02d:%02d\n", Per[q].EndTime / 60 + 8, Per[q].EndTime % 60);
		}
	}
	return 0;
}
